package net.lab1024.sa.admin.module.business.core.material.dao;

import java.util.List;
import net.lab1024.sa.admin.module.business.core.material.domain.entity.MaterialCategoryEntity;
import net.lab1024.sa.admin.module.business.core.material.domain.form.MaterialCategoryQueryForm;
import net.lab1024.sa.admin.module.business.core.material.domain.vo.MaterialCategoryTreeVo;
import net.lab1024.sa.admin.module.business.core.material.domain.vo.MaterialCategoryVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.lab1024.sa.base.common.domain.PageResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * 物料分类表 Dao
 *
 * @Author ADog
 * @Date 2025-09-19 19:48:13
 * @Copyright 1.0
 */

@Mapper
public interface MaterialCategoryDao extends BaseMapper<MaterialCategoryEntity> {

    /**
     * 分页 查询
     *
     * @param page
     * @param queryForm
     * @return
     */
    List<MaterialCategoryVO> queryPage(Page page, @Param("queryForm") MaterialCategoryQueryForm queryForm);

    /**
     * 查询所有可用的分类数据
     *
     * @return
     */
    List<MaterialCategoryTreeVo> selectAllValidCategory();

    /**
     * 修改子节点的isLeaf字段
     *
     * @param parentId
     * @param i
     */
    void updateIsLeaf(@Param("parentId") Long parentId,@Param("isLeaf") int i);
}
